How to send files from a certain path in [location] directive

I've got some Apache files in:
/etc/somewhere

Is it possible that users that go to a location in my domain:
mydomain.com/mylocation will get served the files from /etc/
somewhere ?

I was thinking about:
<Location /mylocation >
DocumentRoot /etc/somewhere
</Location>

Of course, the DocumentRoot is not the correct directive to put there.
What would work?

Thanks,
Amir
Amir [ Do, 06 September 2007 16:17 ] [ ID #1813900 ]

Re: How to send files from a certain path in [location] directive

amir wrote:
> I've got some Apache files in:
> /etc/somewhere
>
> Is it possible that users that go to a location in my domain:
> mydomain.com/mylocation will get served the files from /etc/
> somewhere ?
>
> I was thinking about:
> <Location /mylocation >
> DocumentRoot /etc/somewhere
> </Location>
>
> Of course, the DocumentRoot is not the correct directive to put there.
> What would work?
>
> Thanks,
> Amir
>

Try this:
Alias /mylocation /etc/somewhere

Doc:
Alias directive

Syntax: Alias URL-path file-path|directory-path
Context: server config, virtual host
Status: Base
Module: mod_alias

The Alias directive allows documents to be stored in the local
filesystem other than under the DocumentRoot. URLs with a (%-decoded)
path beginning with url-path will be mapped to local files beginning
with directory-filename.

Example:

Alias /image /ftp/pub/image

A request for http://myserver/image/foo.gif would cause the server to
return the file /ftp/pub/image/foo.gif.

Note that if you include a trailing / on the url-path then the server
will require a trailing / in order to expand the alias. That is, if you
use Alias /icons/ /usr/local/apache/icons/ then the url /icons will not
be aliased.

Note that you may need to specify additional <Directory> sections which
cover the destination of aliases. Aliasing occurs before <Directory>
sections are checked, so only the destination of aliases are affected.
(Note however <Location> sections are run through once before aliases
are performed, so they will apply.)

See also ScriptAlias.
Jim Hayter [ Do, 06 September 2007 16:49 ] [ ID #1813901 ]

Re: How to send files from a certain path in [location] directive

Thanks Jim

Amir
Amir [ Do, 06 September 2007 17:31 ] [ ID #1813903 ]
Webserver » alt.apache.configuration » How to send files from a certain path in [location] directive

Vorheriges Thema: using XAMPP with OOffice installed on Windows XP
Nächstes Thema: VirtualHosts / Subdomain problem